

<?php if ($this->_var['full_page']): ?>
<?php echo $this->fetch('pageheader.htm'); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'js/utils.js,listtable.js')); ?>


<form method="post" action="projects.php" name="listForm" >
  
  <div class="list-div" id="listDiv">
<?php endif; ?>
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
      <a href="javascript:listTable.sort('goods_id'); ">Project ID</a><?php echo $this->_var['sort_goods_id']; ?>
    </th>
	<th><a href="javascript:listTable.sort('goods_name'); ">User Name</a><?php echo $this->_var['sort_goods_name']; ?></th>
    <th><a href="javascript:listTable.sort('goods_name'); ">Subject</a><?php echo $this->_var['sort_goods_name']; ?></th>
    <th><a href="javascript:listTable.sort('goods_sn'); ">Budget</a><?php echo $this->_var['sort_goods_sn']; ?></th>
    <th><a href="javascript:listTable.sort('is_on_sale'); ">Launch Date</a><?php echo $this->_var['sort_is_on_sale']; ?></th>
	<th><a href="javascript:listTable.sort('is_on_sale'); ">Proposals Number</a><?php echo $this->_var['sort_is_on_sale']; ?></th>
    <th><a href="javascript:listTable.sort('is_best'); ">Status</a><?php echo $this->_var['sort_is_best']; ?></th>
    <th>Handler</th>
  <tr>
  <?php $_from = $this->_var['projects_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'project');if (count($_from)):
    foreach ($_from AS $this->_var['project']):
?>
  <tr>
	<td style="text-align:center"><input type="checkbox" name="checkboxes[]" value="<?php echo $this->_var['project']['pid']; ?>" onclick="changeAction()"  /><?php echo $this->_var['project']['pid']; ?></td>
	<td class="first-cell" style="text-align:center"><?php echo htmlspecialchars($this->_var['project']['user_name']); ?></span></td>
	<td class="first-cell" style="text-align:center"><a href="projects.php?act=project_detail&pid=<?php echo $this->_var['project']['pid']; ?>"><?php echo htmlspecialchars($this->_var['project']['subject']); ?></a></td>
    <td style="text-align:center"><span onclick="listTable.edit(this, 'edit_goods_sn', <?php echo $this->_var['project']['goods_id']; ?>)"><?php echo $this->_var['project']['budgetType']; ?></span></td>
    <td style="text-align:center"><span onclick="listTable.edit(this, 'edit_goods_price', <?php echo $this->_var['project']['goods_id']; ?>)"><?php echo $this->_var['project']['createdDate']; ?>

    </span></td>
    <td style="text-align:center"><span onclick="listTable.edit(this, 'edit_goods_number', <?php echo $this->_var['project']['goods_id']; ?>)"><a href="proposals.php?act=proposals_list&pid=<?php echo $this->_var['project']['pid']; ?>"><?php echo $this->_var['project']['proposalsNum']; ?></a></span></td>
	<td style="text-align:center"><span onclick="listTable.edit(this, 'edit_goods_number', <?php echo $this->_var['project']['goods_id']; ?>)"><?php echo $this->_var['project']['status']; ?></span></td>
    <td style="text-align:center">
      <a href="projects.php?act=project_detail&pid=<?php echo $this->_var['project']['pid']; ?>" title="View"><img src="/admin/images/icon_view.gif" width="16" height="16" border="0" /></a>
      <a href="projects.php?act=project_delete&pid=<?php echo $this->_var['project']['pid']; ?>" title="Delete"><img src="/admin/images/icon_drop.gif" width="16" height="16" border="0" /></a>
    </td>
  </tr>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</table>



<table id="page-table" cellspacing="0">
  <tr>
    <td align="right" nowrap="true">
    <?php echo $this->fetch('page.htm'); ?>
    </td>
  </tr>
</table>

<?php if ($this->_var['full_page']): ?>
</div>

<div>
  <input type="hidden" name="act" value="projects_delete" />
  <input type="submit" value="Delete Selected" id="btnSubmit" name="btnSubmit" class="button"  disabled="true"/>
</div>
</form>

<?php echo $this->fetch('pagefooter.htm'); ?>
<?php endif; ?>
<script>
function changeAction()
{
	
	var oCheckBox = document.getElementsByName('checkboxes[]');
	for(var i = 0; i < oCheckBox.length; i++)
	{
		if(oCheckBox[i].checked == true)
		{
			document.getElementById('btnSubmit').removeAttribute('disabled');
			return 0;
		}
	}
	document.getElementById('btnSubmit').setAttribute('disabled','disabled');
}
</script>